//
//  UIView+Frame.m
//  BaiSi
//
//  Created by Sycamore on 16/4/27.
//  Copyright © 2016年 Sycamore. All rights reserved.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)

- (void)setBs_X:(CGFloat)bs_X
{
    CGRect frame = self.frame;
    frame.origin.x = bs_X;
    self.frame = frame;
}

- (void)setBs_Y:(CGFloat)bs_Y
{
    CGRect frame = self.frame;
    frame.origin.y = bs_Y;
    self.frame = frame;

}

- (void)setBs_width:(CGFloat)bs_width
{
    CGRect frame = self.frame;
    frame.size.width = bs_width;
    self.frame = frame;
}

- (void)setBs_height:(CGFloat)bs_height
{
    CGRect frame = self.frame;
    frame.size.height = bs_height;
    self.frame = frame;
}

- (void)setBs_centerX:(CGFloat)bs_centerX
{
    CGPoint center = self.center;
    center.x = bs_centerX;
    self.center = center;
}

- (void)setBs_centerY:(CGFloat)bs_centerY
{
    CGPoint center = self.center;
    center.y = bs_centerY;
    self.center = center;
}

- (CGFloat)bs_X
{
    return self.frame.origin.x;
}

- (CGFloat)bs_Y
{
    return self.frame.origin.y;
}

- (CGFloat)bs_width
{
    return self.frame.size.width;
}

- (CGFloat)bs_height
{
    return self.frame.size.height;
}

- (CGFloat)bs_centerX
{
    return self.center.x;
}

- (CGFloat)bs_centerY
{
    return self.center.y;
}

+ (instancetype)ViewFromNib
{
    return [[[NSBundle mainBundle]loadNibNamed:NSStringFromClass(self) owner:nil options:nil]lastObject];
}


@end
